Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation round number oracle #3175

Merged
merged 2 commits into from
Jan 28, 2025
Merged

Validation round number oracle #3175

merged 2 commits into from
Jan 28, 2025

Conversation

afck
Copy link
Contributor

@afck afck commented Jan 23, 2025

Motivation

For most uses of permissionless rounds (#3162), applications need to have access to the round number, at least in multi-leader rounds.

Proposal

Expose the round number in which the block is being validated to the contract.

This is only Some in multi-leader rounds.

Test Plan

An example application using this will be added in a separate PR.

Release Plan

  • Nothing to do / These changes follow the usual release cycle.

Links

@@ -127,6 +128,13 @@ interface contract-system-api {
storage-size-delta: u32,
}

variant round {
fast,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're in a fast round, should we always fail this oracle call?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We kind of do, since oracles are always disabled in fast rounds.

Du you think we should not even expose the variant to contracts? I.e. have a different Round type in the SDK with one less variant?

Copy link
Contributor

@ma2bd ma2bd Jan 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I suspect we should avoid coupling execution and the BFT internals more than needed here. Perhaps just expose a multi-leader-round as Option<u32>? (or u32 and the call fails if there is no such round?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it! That also solves the edge case with the timeout: Whenever we do have to wait for a timeout, it can't be a multi-leader round anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 5361eb2.

@afck afck marked this pull request as ready for review January 27, 2025 16:06
@afck afck marked this pull request as draft January 27, 2025 16:39
@afck afck marked this pull request as ready for review January 28, 2025 14:07
@afck afck changed the title Validation round oracle Validation round number oracle Jan 28, 2025
@afck afck merged commit e35c25f into linera-io:main Jan 28, 2025
21 checks passed
@afck afck deleted the round-oracle branch January 28, 2025 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Round-number oracle App-based permissionless consensus rounds
2 participants